<!DOCTYPE html>
{% extends 'base.html' %}
{% load crispy_forms_tags %}
{% load static %}
{% block content %}
<html>
   <head>
      <meta charset="utf-8">
      <meta http-equiv="X-UA-Compatible" content="IE=edge">
      <title>Django_Voting</title>
      <link rel="preconnect" href="https://fonts.googleapis.com">
      <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
      <link href="https://fonts.googleapis.com/css2?family=Exo+2:wght@100;400&display=swap" rel="stylesheet">
      <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
         integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
      <!-- nav-bar -->
      <link href="https://getbootstrap.com/docs/5.3/examples/sticky-footer-navbar/sticky-footer-navbar.css"
         rel="stylesheet">
   </head>
   <body class="bg-warning-subtle">
      {% include 'navbar.html' %}
      <div></div>
      <div class="row row-cols-2 row-cols-md-3 g-4 mt-5">
         {% for i in data %}
         <div class="col">
            <div class="card border-dark mb-3" style="max-width: 25rem;">
               <div class="card-header">
                  <div class="d-flex justify-content-between">

                     <div class="p-2 flex-grow-1">{{i.title}}</div>
                     <div class="p-2">от: {{i.author}}</div>

                  </div>
<!--                  {{i.title}}-->
<!--                  <h6>{{i.author}}</h6>-->
               </div>
               <div class="card-body">
                  <h5 class="card-title">{{i.description}}</h5>
                  <p class="card-text">
                     <!-- =========================== -->
                  <table class="space_between" style="width: 90%; height: 80%">
                     {% for variant in variants %}
                     {% if variant.voting_id == i %}
                     <tr>
                        <td>
                           <div class="answer_choice">
                              <div class="form-check"
                              <div class="btn-group" role="group" aria-label="Basic example">
                                 <a href="?variant={{variant.id}}">
                                 <button type="button" class="btn btn-primary">{{ variant.description }}</button>
                                 </a>
                              </div>
                              {{test}}
                           </div>
               </div>
               </td>
               <td align="left">
               <div class="rectangle_1"></div>
               </td>
               </tr>
               {% endif %}
               {% endfor %}
               </table>
               <!-- =========================== -->
               </p>
            </div>

         </div>
      </div>
      {% endfor %}
      </div>
   </body>
</html>
{% endblock %}